#include "../include/student.h"

Student::Student(const std::string ID, const std::string studentName)
: studentId(ID), name(studentName){}

Student::Student(){}

void Student::writeToFile(std::ofstream &file){
    if(file.is_open()){
        file << "姓名:" << name << ",学号:" << studentId << "\n";
    }
}
    // 打印属性的方法
void Student::print() const{
    std::cout << "学生：" << std::endl;
    std::cout << " 姓名：" << name << std::endl;
    std::cout << " 学号：" << studentId << std::endl;
}

std::string Student::getId() const{
    return studentId;
}

std::string Student::getName() const{
    return name;
}

// Student::Student(std::string fileName){
//     std::ifstream file(fileName);
//     if(file.is_open()){

//     }
// }